#ifndef HISTREAMER_PLUGIN_COMMON_TAGS_H
#define HISTREAMER_PLUGIN_COMMON_TAGS_H

#include <string>
#include <map>
#include "any.h"

namespace OHOS {
namespace Multimedia {
namespace Plugin {

enum TagSection : uint8_t {
    REGULAR = 1,
    MEDIA = 2,
    AUDIO_UNIVERSAL = 3,
    AUDIO_SPECIFIC = 4,
    VIDEO_UNIVERSAL = 5,
    VIDEO_SPECIFIC = 6,
    MAX_SECTION = 64,
};

enum AudioFormat : uint8_t {
    MPEG = 1,
    AAC,
};

enum VideoFormat : uint8_t {
    H264 = 1,
};

#define MAKE_AUDIO_SPECIFIC_START(format) (SECTION_AUDIO_SPECIFIC_START | ((format) << 8U))

enum struct Tag : uint32_t {
    INVALID = 0,
    SECTION_REGULAR_START = TagSection::REGULAR << 16U,
    SECTION_MEDIA_START = TagSection::MEDIA << 16U,
    SECTION_AUDIO_UNIVERSAL_START = TagSection::AUDIO_UNIVERSAL << 16U,
    SECTION_AUDIO_SPECIFIC_START = TagSection::AUDIO_SPECIFIC << 16U,
    SECTION_VIDEO_UNIVERSAL_START = TagSection::VIDEO_UNIVERSAL << 16U,
    SECTION_VIDEO_SPECIFIC_START = TagSection::VIDEO_SPECIFIC << 16U,

    MIME = SECTION_REGULAR_START + 1,
    STREAM_INDEX,
    REQUIRED_OUT_BUFFER_CNT,

    MEDIA_TITLE = SECTION_MEDIA_START + 1,
    MEDIA_ARTIST,
    MEDIA_LYRICIST,
    MEDIA_ALBUM,
    MEDIA_ALBUM_ARTIST,
    MEDIA_DATE,
    MEDIA_COMMENT,
    MEDIA_GENRE,
    MEDIA_COPYRIGHT,
    MEDIA_LANGUAGE,
    MEDIA_DESCRIPTION,
    MEDIA_LYRICS,
    MEDIA_DURATION,
    MEDIA_FILE_SIZE,
    MEDIA_BITRATE,
    MEDIA_FILE_EXTENSION,
    MEDIA_CODEC_CONFIG,
    MEDIA_DTS,
    MEDIA_PTS,
    MEDIA_POSITION,
    MEDIA_EOS,

    AUDIO_CHANNELS = SECTION_AUDIO_UNIVERSAL_START + 1,
    AUDIO_CHANNEL_LAYOUT,
    AUDIO_SAMPLE_RATE,
    AUDIO_SAMPLE_FORMAT,
    ADUIO_SAMPLE_PER_FRAME,

    AUDIO_SPECIFIC_MPEG_START = MAKE_AUDIO_SPECIFIC_START(AudioFormat::MPEG),
    AUDIO_MPEG_VERSION,
    AUDIO_MPEG_LAYER,

    AUDIO_SPECIFIC_AAC_START = MAKE_AUDIO_SPECIFIC_START(AudioFormat::AAC),
    AUDIO_AAC_PROFILE,
    AUDIO_AAC_LEVEL,
    AUDIO_AAC_STREAM_FORMAT,

    VIDEO_WIDTH = SECTION_VIDEO_UNIVERSAL_START + 1,
    VIDEO_HEIGHT,
    VIDEO_STRIDE,
    VIDEO_PIXEL_FORMAT,
};

using ValueType = Any;

using TagMap = std::map<Tag, ValueType>;

} // namespace Plugin
} // namespace Multimedia
} // namespace OHOS
#endif
